﻿@{
    Layout = null;
}
<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>iCode网站管理系统--登录</title>
    <script type="text/javascript" src="@Url.Content("~/Content/DWC/js/jquery-1.7.2.js")"></script>
    <link type="text/css" rel="Stylesheet" href="@Url.Content("~/Content/login-box.css")" />

    <script type="text/javascript">
        $(function () {
            $("#btnSub").click(function () {
                valideForm();
            })

            $('body').bind('keyup', function (event) {
                // aa(event);
                if (event.keyCode == 13) {
                    valideForm();
                }
            });
        })

        function valideForm() {
            var username = $("#username").val();
            var userpwd = $("#password").val();
            if ($.trim(username) == "" && $.trim(userpwd) == "") {
                $("#error").text("请输入用户名和密码");
                return false;
            }
            if ($.trim(username) == "") {
                $("#error").text("请输入用户名");
                return false;
            }
            if ($.trim(userpwd) == "") {
                $("#error").text("请输入密码");
                return false;
            }
            $("#loginForm").submit();
        }
    </script>
</head>
<body>
    <div style="">
        <div id="login-box" style="margin:0px auto">
            <h2>Login</h2>
            <br />
            <label id="error">@ViewBag.Error</label>
            <br />
            <form id="loginForm" method="post" action="@Url.Action("Login","Home")">
                <div id="login-box-name" style="margin-top:20px;">用户名:</div><div id="login-box-field" style="margin-top:20px;"><input name="username" class="form-login" id="username" title="Username" value="" size="30" maxlength="2048" /></div>
                <div id="login-box-name">密码:</div><div id="login-box-field"><input name="password" id="password" type="password" class="form-login" title="Password" value="" size="30" maxlength="2048" /></div>
                <br />
                @*<span class="login-box-options">
                <label>
                @Html.CheckBox("remember", true) Remember Me
                </label>
                </span>*@

                <br />
                <br />
                <a href="#" id="btnSub"><img src="~/Content/images/login-btn.png" width="103" height="42" style="margin-left:90px;" /></a>
            </form>
        </div>
    </div>
</body>
</html>